home *** CD-ROM | disk | FTP | other *** search
- on sendmail
- set addressString to "iclay@100percent.org"
- set subjectString to urlEncode("3d stuff")
- set messageString to urlEncode("All comments warmly welcome. Ian Clay, (Director), Trees Ltd")
- gotoNetPage("mailto:" & addressString & "?subject=" & subjectString & "&body=" & messageString)
- end
-
- on urlEncode whichString
- if not stringp(whichString) then
- exit
- end if
- set reservedListASCII to [32, 123, 125, 124, 92, 94, 126, 91, 93, 39, 35, 37, 60, 62, 34, 59, 44, 47, 63, 58, 64, 61, 38, 13]
- set replaceList to ["%20", "%7B", "%7D", "%7C", "%5C", "%5E", "%7E", "%5B", "%5D", "%27", "%23", "%25", "%3C", "%3E", "%22", "%3B", "%2C", "%2F", "%3F", "%3A", "%40", "%3D", "%26", "%0D"]
- set sLength to the number of chars in whichString
- repeat with i = 1 to sLength
- set currentChar to charToNum(char i of whichString)
- set replaceLoc to getOne(reservedListASCII, currentChar)
- if replaceLoc then
- put getAt(replaceList, replaceLoc) into char i of whichString
- set i to i + 2
- set sLength to sLength + 2
- end if
- end repeat
- return whichString
- end
-